package com.masterlau.entry;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author MasterLau
 */
final class Module implements Serializable {
    private static final long serialVersionUID = 1L;
    public Integer order;
    public String name;
    public String artifact;
    public List<Server> servers;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final Module module = (Module) o;
        return Objects.equals(order, module.order) && Objects.equals(name, module.name) && Objects.equals(artifact, module.artifact) && Objects.equals(servers, module.servers);
    }

    @Override
    public int hashCode() {
        int result = order != null ? order.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (artifact != null ? artifact.hashCode() : 0);
        return 31 * result + (servers != null ? servers.hashCode() : 0);
    }
}
